/**
 * @(#)ApkBaseEnum.java 2016年11月23日
 * Copyright(C) 2016 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 运营商类型
 * 
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
public enum CarrierEnum {
	TELECOM(0, "电信"), UNICOM(1, "联通"), MOBILE(2, "移动")
	//, IRON(3, "铁通")
	;

	private int type;
	private String name;

	private CarrierEnum(int type, String name) {
		this.type = type;
		this.name = name;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private static Map<Integer, CarrierEnum> map = new HashMap<Integer, CarrierEnum>();

	static {
		for (CarrierEnum apkBaseEnum : CarrierEnum.values()) {
			map.put(apkBaseEnum.type, apkBaseEnum);
		}
	}

	public static CarrierEnum valueOf(int type) {
		return map.get(type);
	}
}
